(global.webpackJsonp = global.webpackJsonp || []).push([ [ "integral/order/putOrder" ], {
    "084c": function(t, e, o) {
        (function(t) {
            Object.defineProperty(e, "__esModule", {
                value: !0
            }), e.default = void 0;
            var r = o("26cb"), n = o("a71e"), i = o("8434"), a = function(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }(o("03b8")), s = o("03c7"), d = o("8f9b"), c = o("9b04"), u = (o("db8f"), o("0cc1")), l = (o("b806"), 
            o("7960")), f = o("4771");
            function p(t, e) {
                var o = Object.keys(t);
                if (Object.getOwnPropertySymbols) {
                    var r = Object.getOwnPropertySymbols(t);
                    e && (r = r.filter(function(e) {
                        return Object.getOwnPropertyDescriptor(t, e).enumerable;
                    })), o.push.apply(o, r);
                }
                return o;
            }
            function g(t, e, o) {
                return e in t ? Object.defineProperty(t, e, {
                    value: o,
                    enumerable: !0,
                    configurable: !0,
                    writable: !0
                }) : t[e] = o, t;
            }
            var y = {
                components: {},
                computed: function(t) {
                    for (var e = 1; e < arguments.length; e++) {
                        var o = null != arguments[e] ? arguments[e] : {};
                        e % 2 ? p(Object(o), !0).forEach(function(e) {
                            g(t, e, o[e]);
                        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(o)) : p(Object(o)).forEach(function(e) {
                            Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(o, e));
                        });
                    }
                    return t;
                }({}, (0, r.mapGetters)([ "configs", "mainColor", "user", "iphoneXStyle", "priceColor" ])),
                data: function() {
                    var t;
                    return g(t = {
                        isaddress: !1,
                        maskState: 0,
                        payType: 1,
                        addressData: {},
                        good_arr: [],
                        orderComputeInfo: {},
                        countAllMoney: 0,
                        submitInfo: {},
                        payData: {
                            type: 1,
                            money: "",
                            pay: ""
                        },
                        res: ""
                    }, "payType", 1), g(t, "total_price", 0), g(t, "type", ""), g(t, "isPay", -1), g(t, "isShow", !1), 
                    g(t, "show", !1), g(t, "good_type", 1), g(t, "order_id", ""), g(t, "isShowYunFei", !1), 
                    g(t, "url", ""), g(t, "isAdress", !0), g(t, "good_id", ""), g(t, "info", {
                        integral: ""
                    }), t;
                },
                watch: {},
                created: function() {
                    this.isPayType();
                },
                onLoad: function(e) {
                    var o = this;
                    if (o.url = "/integral/address/addressList?types=" + e.type + "&good_type=" + e.good_type + "&type=3", 
                    !(0, n.isEmpty)(e)) {
                        this.type = e.type, this.good_type = e.good_type, this.good_id = e.id;
                        var r = {
                            id: this.good_id
                        };
                        (0, s.integralGoodInfo)(r).then(function(t) {
                            o.info = t, o.good_arr.push({
                                id: t.id,
                                img: t.imglist[0],
                                title: t.title,
                                integral: t.integral,
                                price: t.price
                            }), o.isShow = !0, 1 == o.good_type ? o.getAddressList() : o.calculationFun();
                        });
                    }
                    (0, n.isEmpty)(e.isAdress) && (t.setStorage({
                        key: "integralId" + a.default.uniacid,
                        data: e.id,
                        success: function() {},
                        fail: function() {}
                    }), t.removeStorage({
                        key: "addressjf" + a.default.uniacid,
                        success: function(t) {
                            1 == o.good_type ? o.getAddressList() : o.calculationFun();
                        },
                        fail: function(t) {
                            1 == o.good_type ? o.getAddressList() : o.calculationFun();
                        }
                    }));
                },
                onShow: function() {
                    var t = this;
                    (0, f.getStorageSync)("addressjf").then(function(e) {
                        (0, n.isEmpty)(JSON.parse(e.data)) ? (0, n.isEmpty)(JSON.parse(e.data)) && (t.isaddress = !1) : (t.addressData = JSON.parse(e.data), 
                        t.isaddress = !0, t.newOrder());
                    }, function(t) {});
                },
                onHide: function() {
                    t.removeStorage({
                        key: "addressjf" + a.default.uniacid,
                        success: function(t) {},
                        fail: function(t) {}
                    });
                },
                onUnload: function() {
                    t.removeStorage({
                        key: "addressjf" + a.default.uniacid,
                        success: function(t) {},
                        fail: function(t) {}
                    }), t.removeStorage({
                        key: "integralId" + a.default.uniacid,
                        success: function(t) {},
                        fail: function(t) {}
                    });
                },
                methods: {
                    getDetial: function(t) {
                        var e = this;
                        (0, f.getStorageSync)("integralId").then(function(o) {
                            e.good_id = o.data;
                            var r = {
                                id: o.data
                            };
                            (0, s.integralGoodInfo)(r).then(function(o) {
                                e.info = o, e.good_arr = [], e.good_arr.push({
                                    id: o.id,
                                    img: o.imglist[0],
                                    title: o.title,
                                    integral: o.integral,
                                    price: o.price
                                }), e.$forceUpdate(), 1 == t ? e.newOrder() : 2 == t && (1 == e.good_type ? e.getAddressList() : e.calculationFun());
                            });
                        }, function(t) {});
                    },
                    isPayType: function() {
                        var t = this;
                        (0, c.payMethod)().then(function(e) {
                            -1 == e.indexOf("wxpay") && (t.isPay = 0);
                        });
                    },
                    choosePay: function(t) {
                        this.isPay = 1 == t.typeId ? 3 : 2, this.submit();
                    },
                    getAddressList: function() {
                        var t = this, e = this;
                        (0, d.defaultMyAddress)({}).then(function(o) {
                            var r = 0;
                            if ((0, n.isEmpty)(o.id)) {
                                for (var i = 0; i < t.good_arr.length; i++) r = parseFloat(parseFloat(r) + parseFloat(t.good_arr[i].price));
                                t.total_price = parseFloat(r).toFixed(2), t.countAllMoney = t.total_price;
                            } else e.isaddress = !0, e.addressData = o, e.newOrder();
                            e.isShow = !0;
                        });
                    },
                    newOrder: function() {
                        this.calculationFun();
                    },
                    calculationFun: function() {
                        for (var t = 0, e = 0; e < this.good_arr.length; e++) t = parseFloat(parseFloat(t) + parseFloat(this.good_arr[e].price));
                        this.total_price = parseFloat(t).toFixed(2), this.countAllMoney = 1 == this.good_type ? parseFloat(parseFloat(t)).toFixed(2) : parseFloat(t);
                    },
                    numberChange: function(t) {
                        this.number = t.number;
                    },
                    changePayType: function(t) {
                        this.payType = t;
                    },
                    submit: function() {
                        var t = this;
                        this.isaddress || 1 != t.good_type ? (0, n.isEmpty)(this.countAllMoney) && 1 == t.good_type || (0, 
                        l.h5JudgeLogin)(2).then(function(e) {
                            e || t.submitOrder();
                        }) : this.$toast("请选择地址", "none");
                    },
                    submitOrder: function() {
                        var t = this;
                        if (!this.countAllMoney && 1 == t.good_type) return !1;
                        if ((0, n.isEmpty)(t.addressData.province_id) && 1 == t.good_type) return t.$toast("地址不能为空", "none");
                        if (0 == t.isPay) return t.$toast("未设置支付方式", "none"), !1;
                        var e = {
                            id: this.good_id,
                            name: t.addressData.name,
                            phone: t.addressData.phone,
                            address: t.addressData.province + t.addressData.city + t.addressData.district + t.addressData.detail,
                            province_id: 1 == t.good_type ? t.addressData.province_id : 0,
                            city_id: 1 == t.good_type ? t.addressData.city_id : 0,
                            district_id: 1 == t.good_type ? t.addressData.district_id : 0,
                            payType: 1,
                            remark: t.submitInfo.remark,
                            order_id: ""
                        };
                        t.show = !0, (0, s.subIntegralOrder)(e).then(function(e) {
                            if (0 == parseFloat(t.info.price)) return (0, i.route)({
                                url: "/integral/index",
                                type: 3,
                                data: {}
                            }), !1;
                            (0, u.pay)(e, t.orderSuccess, t.orderFail, "");
                        });
                    },
                    orderSuccess: function(t) {
                        (0, i.route)({
                            url: "/integral/index",
                            type: 3,
                            data: {}
                        });
                    },
                    orderFail: function(t) {
                        console.log("失败啦!");
                    },
                    stopPrevent: function() {}
                }
            };
            e.default = y;
        }).call(this, o("543d").default);
    },
    27985: function(t, e, o) {
        o.r(e);
        var r = o("874e"), n = o("33ce");
        for (var i in n) "default" !== i && function(t) {
            o.d(e, t, function() {
                return n[t];
            });
        }(i);
        o("c4d0");
        var a = o("f0c5"), s = Object(a.a)(n.default, r.b, r.c, !1, null, null, null, !1, r.a, void 0);
        e.default = s.exports;
    },
    "33ce": function(t, e, o) {
        o.r(e);
        var r = o("084c"), n = o.n(r);
        for (var i in r) "default" !== i && function(t) {
            o.d(e, t, function() {
                return r[t];
            });
        }(i);
        e.default = n.a;
    },
    "5d22": function(t, e, o) {},
    "874e": function(t, e, o) {
        o.d(e, "b", function() {
            return r;
        }), o.d(e, "c", function() {
            return n;
        }), o.d(e, "a", function() {});
        var r = function() {
            var t = this, e = (t.$createElement, t._self._c, t.__map(t.good_arr, function(e, o) {
                return {
                    $orig: t.__get_orig(e),
                    m0: parseFloat(e.integral),
                    m1: parseFloat(e.price)
                };
            })), o = parseFloat(t.info.price), r = parseFloat(t.info.price);
            t.$mp.data = Object.assign({}, {
                $root: {
                    l0: e,
                    m2: o,
                    m3: r
                }
            });
        }, n = [];
    },
    acb8: function(t, e, o) {
        (function(t) {
            o("1067"), r(o("66fd"));
            var e = r(o("27985"));
            function r(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            wx.__webpack_require_UNI_MP_PLUGIN__ = o, t(e.default);
        }).call(this, o("543d").createPage);
    },
    c4d0: function(t, e, o) {
        var r = o("5d22");
        o.n(r).a;
    }
}, [ [ "acb8", "common/runtime", "common/vendor" ] ] ]);